<?php

class IndexController extends Zend_Controller_Action
{

    public function init() {}
    
   /*
    * main layout frames
    */
    public function indexAction() {}
    
    /*
     * main toolbar
     */
    public function toolbarAction()
    {
        $this->_helper->layout->setLayout('top');
        $resource = new HTech_Model_Resource();
        $this->view->resources = $resource->getResources();     
    }
    
    /*
     * main menu
     */    
    public function menuAction()
    {
        $this->_helper->layout->setLayout('left'); 
    }
    
    /*
     * user's defined bookmarks
     */
    public function bookmarkAction()
    {
        $this->_helper->layout->setLayout('left');  
    }

    /*
     * mfi branches and officers represented in a tree
     */
    public function inspectorAction()
    {
        $inspector = new HTech_Model_Inspector();
        $this->view->inspector = $inspector->getItems();
        $this->_helper->layout->setLayout('left'); 
    }
    
    /*
     * session info like login time, timezone, 
     * user identity, role, language options, etc.
     */
    public function sessionAction()
    { 
        $this->_helper->layout->setLayout('left');  
        $this->view->cf = Zend_Registry::get('HT_Config');  
        $this->view->identity = Zend_Auth::getInstance()->getIdentity();
        $this->view->localeOpt = HTech_Locale::getLocaleOpt();
        $this->view->language = $this->view->localeOpt[Zend_Registry::get('Zend_Locale')->toString()];
        $this->view->date = new Zend_Date();
    }
    
    public function inboxAction()
    {
        //$this->_helper->layout->setLayout('grid');  
        $identity = Zend_Auth::getInstance()->getIdentity();
        $this->redirect(sprintf('/admin/message/browse/UserId/%s/Recipient/%s',
                $identity->UserId,$identity->Username)); 
    }

}

